load("//bazel:skia_rules.bzl", "exports_files_legacy", "skia_cc_library")

package(
    default_applicable_licenses = ["//:license"],
)

licenses(["notice"])

exports_files_legacy()

skia_cc_library(
    name = "legacy_skunicode",
    srcs = [
        "//modules/skunicode/src:bidi_full_srcs",
        "//modules/skunicode/src:icu_bidi_srcs",
        "//modules/skunicode/src:icu_srcs",
        "//modules/skunicode/src:srcs",
    ],
    hdrs = ["//modules/skunicode/include:hdrs"],
    defines = [
        "SK_UNICODE_AVAILABLE",
        "SK_UNICODE_ICU_IMPLEMENTATION",
    ],
    visibility = ["//:__subpackages__"],
    deps = [
        "//:skia_internal",
        "@icu",
    ],
)

skia_cc_library(
    name = "skunicode_core",
    srcs = [
        "//modules/skunicode/src:srcs",
    ],
    hdrs = ["//modules/skunicode/include:core_hdrs"],
    defines = [
        "SK_UNICODE_AVAILABLE",
    ],
    visibility = [
        "//:__pkg__",
        "//modules:__subpackages__",
    ],
    deps = [
        "//:core",
        "//src/base",
        "//src/core:core_priv",
    ],
)

skia_cc_library(
    name = "skunicode_icu",
    srcs = [
        "//modules/skunicode/src:bidi_full_srcs",
        "//modules/skunicode/src:icu_bidi_srcs",
        "//modules/skunicode/src:icu_core_srcs",
    ] + select({
        "@platforms//os:android": [
            "//modules/skunicode/src:runtime_srcs",
        ],
        "//conditions:default": [
            "//modules/skunicode/src:builtin_srcs",
        ],
    }),
    hdrs = [
        "//modules/skunicode/include:core_hdrs",
        "//modules/skunicode/include:icu_hdrs",
    ],
    defines = [
        "SK_UNICODE_AVAILABLE",
        "SK_UNICODE_ICU_IMPLEMENTATION",
    ] + select({
        "@platforms//os:android": ["SK_UNICODE_RUNTIME_ICU_AVAILABLE"],
        "//conditions:default": [],
    }),
    features = ["layering_check"],
    visibility = [
        "//:__pkg__",
        "//modules:__subpackages__",
    ],
    deps = [
        ":skunicode_core",
        "//:core",
        "//src/base",
        "//src/core:core_priv",
    ] + select({
        "@platforms//os:android": ["@icu//:icu_headers"],
        "//conditions:default": ["@icu"],
    }),
)
